package com.app.twth.base;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.app.twth.bean.LoadingBean;

public class BaseViewModel extends ViewModel {
    protected BaseModel mModel;
    public MutableLiveData<String> infoResultCode = new MutableLiveData<>();
    public MutableLiveData<LoadingBean> isLoading = new MutableLiveData<>();

    /**
     * 解除model中所有订阅者
     */
    public void dispose() {
        if (mModel != null) {
            mModel.dispose();
            mModel = null;
        }
    }
}
